Interface NetworkFile

All Superinterfaces:
IPCObject
All Known Subinterfaces:
ActivityFile
All Known Implementing Classes:
ActivityFileImpl, NetworkFileImpl

public interface NetworkFile extends IPCObject
Information provided by the PKI file:

    \class NetworkFile
    
    \brief NetworkFile is the main system file for the application. It holds all the configurations for the engine as well as the UI.
    
    \example appWindow().getActiveFile()
    
Author:
Auto-generated
  • Method Details

    • getSavedFilename

      String getSavedFilename()
      Information provided by the PKI file:
      
          \brief Returns the filename of the currently opened file.
          
          \return QString, the filename of the currently opened file.
          
              
      Returns:
      String Returns a String
    • getVersion

      String getVersion()
      Information provided by the PKI file:
      
          \brief Returns the version the current file was saved in.
          
          \return QString, the version the current file was saved in.
          
              
      Returns:
      String Returns a String
    • getNetworkDescription

      String getNetworkDescription()
      Information provided by the PKI file:
      
          \brief Returns the network description of the current file.
          
          \return QString, the network description.
          
              
      Returns:
      String Returns a String
    • setNetworkDescription

      void setNetworkDescription(String description)
      Information provided by the PKI file:
      
          \brief Sets the network description for the current file.
          
          \param description, the network description for the current file.
          
              
      Parameters:
      description - Takes in a parameter of description
    • getOptions

      Options getOptions()
      Information provided by the PKI file:
      
          \brief Returns the option settings of the current file.
          
          \return Options, the Options object of the current file.
          
              
      Returns:
      Options Returns a Options
    • getMainNetwork

      Network getMainNetwork()
      Information provided by the PKI file:
      
          \brief Returns the network of the current file.
          
          \return Network, the Network object of the current file.
          
              
      Returns:
      Network Returns a Network
    • getUserProfile

      UserProfile getUserProfile()
      Information provided by the PKI file:
      
          \brief Returns the user profile of the current file.
          
          \return UserProfile, the UserProfile object of the current file.
          
              
      Returns:
      UserProfile Returns a UserProfile
    • getMainSimulation

      Simulation getMainSimulation()
      Information provided by the PKI file:
      
          \brief Returns the simulation of the current file.
          
          \return Simulation, the Simulation object of the current file.
          
              
      Returns:
      Simulation Returns a Simulation
    • getWorkspace

      Workspace getWorkspace()
      Information provided by the PKI file:
      
          \brief Returns the workspace of the current file.
          
          \return Workspace, the Workspace object of the current file.
          
              
      Returns:
      Workspace Returns a Workspace
    • getActivityScriptEngine

      ActivityScriptEngine getActivityScriptEngine()
      Information provided by the PKI file:
      
          \brief Returns the activity script engine of the current file.
          
          \return ActivityScriptEngine, the ActivityScriptEngine object of the current file.
          
              
      Returns:
      ActivityScriptEngine Returns a ActivityScriptEngine
    • getScriptEngine

      ActivityScriptEngine getScriptEngine()
      Information provided by the PKI file:
      
          \brief Returns the script engine of the current file.
          
          \return ActivityScriptEngine, the ActivityScriptEngine object of the current file.
          
              
      Returns:
      ActivityScriptEngine Returns a ActivityScriptEngine
    • resetScriptEngine

      void resetScriptEngine()
      Information provided by the PKI file:
      
          \brief Removes the current activity script engine and creates a new one.
          
          \remark All loaded script results will be lost.
          
              
    • addScript

      boolean addScript(String id, String contents)
      Information provided by the PKI file:
      
          \brief Adds a script to the activity file.
          
          \param id, the ID (e.g. filename) of the the script.
          \param contents, the content of the script.
          
          \return bool, true if successful, otherwise false.
          
              
      Parameters:
      id - Takes in a parameter of id
      contents - Takes in a parameter of contents
      Returns:
      boolean Returns a boolean
    • addScriptFile

      boolean addScriptFile(String id, String filename)
      Information provided by the PKI file:
      
          \brief Adds the script contents to the activity file from a file path.
          
          \param id, the ID (e.g. filename) of the the script.
          \param filename, the path including the filename of the script.
          
          \remark The script is not evaluated immediately.
          
          \return bool, true if the script was successfully added, false if not.
          
              
      Parameters:
      id - Takes in a parameter of id
      filename - Takes in a parameter of filename
      Returns:
      boolean Returns a boolean
    • addDefaultScripts

      void addDefaultScripts()
      Information provided by the PKI file:
      
          \brief Resets the scripts to the default scripts.
          
          \remark Missing script files will be addded, existing scripts of the same name will be overwritten.
          
              
    • removeScript

      boolean removeScript(String id)
      Information provided by the PKI file:
      
          \brief Removes the specified script from the activity file hash.
          
          \param id, the ID (e.g. filename) of the script.
          
          \return bool, true if successful, otherwise false.
          
          \remark This will not remove the script contents from memory. However, upon the next resetScriptEngine(), the removed script will not be loaded.
          
              
      Parameters:
      id - Takes in a parameter of id
      Returns:
      boolean Returns a boolean
    • getScript

      String getScript(String id)
      Information provided by the PKI file:
      
          \brief Returns the content of the script with the specified ID.
          
          \param id, the ID (e.g. filename) of the script.
          
          \return QString, the content of the script with the specified ID.
          
              
      Parameters:
      id - Takes in a parameter of id
      Returns:
      String Returns a String
    • getScriptIDs

      List<String> getScriptIDs()
      Information provided by the PKI file:
      
          \brief Returns the list of IDs currently in the system.
          
          \return vector<QString>, the list of IDs currently in the system.
          
              
      Returns:
      List<String> Returns a List<String>
    • addScriptDataStore

      boolean addScriptDataStore(String id, String contents)
      Information provided by the PKI file:
      
          \brief Adds script data store for persistent storage (e.g. constants, options, settings).
          
          \param id, the ID (e.g. name) of the data store.
          \param contents, the content of the data store.
          
          \return bool, true if successful, otherwise false.
          
              
      Parameters:
      id - Takes in a parameter of id
      contents - Takes in a parameter of contents
      Returns:
      boolean Returns a boolean
    • removeScriptDataStore

      boolean removeScriptDataStore(String id)
      Information provided by the PKI file:
      
          \brief Removes the specified script data store for persistent storage (e.g. constants, options, settings).
          
          \param id, the ID (e.g. name) of the data store of interest.
          
          \return bool, true if successful, otherwise false.
          
              
      Parameters:
      id - Takes in a parameter of id
      Returns:
      boolean Returns a boolean
    • getScriptDataStore

      String getScriptDataStore(String id)
      Information provided by the PKI file:
      
          \brief Returns the content of the specified script data store.
          
          \param id, the ID (e.g. name) of the data store of interest.
          
          \return QString, the content of the specified script data store.
          
              
      Parameters:
      id - Takes in a parameter of id
      Returns:
      String Returns a String
    • getScriptDataStoreIDs

      List<String> getScriptDataStoreIDs()
      Information provided by the PKI file:
      
          \brief Returns the list of IDs of script data stores.
          
          \return vector<QString>, the list of IDs of script data stores.
          
              
      Returns:
      List<String> Returns a List<String>
    • getFilterSet

      FilterSet getFilterSet()
      Information provided by the PKI file:
      
          \brief Returns the engine filter set for simulation packets, what is filtered out.
          
          \return FilterSet, the filter set.
          
              
      Returns:
      FilterSet Returns a FilterSet
    • addCustomTrafficType

      boolean addCustomTrafficType(String customType)
      Information provided by the PKI file:
      
          \brief Adds a custom traffic type. Returns true if successful, false otherwise.
          
          \return bool, true if successfully added the custom traffic type, otherwise false.
          
              
      Parameters:
      customType - Takes in a parameter of customType
      Returns:
      boolean Returns a boolean
    • hasCustomTrafficType

      boolean hasCustomTrafficType(String customType)
      Information provided by the PKI file:
      
          \brief Returns whether a custom traffic type is already added.
          
          \return bool, true the custom traffic type is already added, otherwise false.
          
              
      Parameters:
      customType - Takes in a parameter of customType
      Returns:
      boolean Returns a boolean
    • addCustomPduType

      boolean addCustomPduType(String customPduType, String jsonDefinition)
      Information provided by the PKI file:
      
          \brief Adds a custom PDU type. Returns true if successful, false otherwise.
          
          \param customPduType, the custom PDU type name.
          \param jsonDefinition, a JSON string representing the definition of the PDU
          in the following format and must include the following:
          {
          "title": "My Protocol PDU",
          "units": "Bits",
          "unit_marks": [16],
          "width": 32,
          "fields": [{"value": "TYPE: {type}","size": 32},
          {"value": "data: {data}","size": 32}]
          
          \return bool, true if successfully added the custom PDU type, otherwise false.
          
              
      Parameters:
      customPduType - Takes in a parameter of customPduType
      jsonDefinition - Takes in a parameter of jsonDefinition
      Returns:
      boolean Returns a boolean
    • hasCustomPduType

      boolean hasCustomPduType(String customPduType)
      Information provided by the PKI file:
      
          \brief Returns whether a custom PDU type is already added.
          
          \return bool, true the custom traffic PDU is already added, otherwise false.
          
              
      Parameters:
      customPduType - Takes in a parameter of customPduType
      Returns:
      boolean Returns a boolean
    • isActivityFile

      boolean isActivityFile()
      Information provided by the PKI file:
      
          \brief Returns whether this file is an activity file or regular network file
          
              
      Returns:
      boolean Returns a boolean